<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    var a = 10;
    var obj = {
        a: 20,
        fun: function () {
            var a = 30;
            console.log(this.a);
        }
    };
    var fun = obj.fun;
    obj.fun();
    fun();
</script>
</body>
</html>